/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package game;


import game.Player.Player;
import game.Rendering.Camera;
import game.Rendering.GameCanvas;
import game.Rendering.GamePanel;
import javafx.geometry.Bounds;
import javafx.scene.canvas.Canvas;

import javax.swing.*;
import java.awt.*;

public class Helper {

    public static int GAME__WIDTH = 1280, GAME__HEIGHT = 720;

    public static long MILLISECOND = 1000L;

    public static int FPS_LIMIT = 90;

    //public static JFrame gameFrame = null;
    public static Canvas gameCanvas = null;
    //public static GamePanel gp = null;

    public static Scene mainScene = null;

    public static Camera myCamera = null;

    public static Point locationOnScreen(){

        if(GameCanvas.getInstance() != null){
            int yOffset = 0;
            if (!GameCanvas.getStage().isFullScreen()){
                yOffset = 32;
            }
            return new Point((int)GameCanvas.getStage().getX(), (int)GameCanvas.getStage().getY() + yOffset);
        }else{
            return new Point(0,0);
        }
    }

    public static int screenWidth(){
        if(GameCanvas.getInstance() != null){
            return (int)GameCanvas.getInstance().getWidth();
        }else{
            return 0;
        }
    }

    public static int screenHeight(){
        if(GameCanvas.getInstance() != null){
            return (int)GameCanvas.getInstance().getHeight();
        }else{
            return 0;
        }
    }

    public static Point mousePosInWindow(){
        Point mouseScreenPos = MouseInfo.getPointerInfo().getLocation();
        Point windowPos = Helper.locationOnScreen();
        Point mouseWindowPos = new Point(mouseScreenPos.x - windowPos.x, mouseScreenPos.y - windowPos.y);
        return mouseWindowPos;
    }

}
